package com.young.ysepay.controllers;

import com.young.ysepay.service.YsAlipayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;

@RestController
@RequestMapping("/ysAliPay")
public class YsAlipayController {

    @Autowired
    private YsAlipayService ysAlipayService;

    /**
     * 银盛支付宝支付
     * @param paramMap
     * @return
     */
    @PostMapping("/aliPay")
    public Map<String,Object> aliPay(@RequestParam Map<String,String> paramMap){
        return ysAlipayService.ysAliPay(paramMap);
    }
    /**
     * @Description 银盛支付异步回执
     * @Param
     * @return
     **/
    @PostMapping("/callBack")
    public void callBack(@RequestParam Map<String,String> paramMap, HttpServletResponse response) {
        ysAlipayService.aliPayCallBack(paramMap,response);


    }


}
